package com.thread;

public class ThreadSleep {
    public static void main(String[] args) {

        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 20; i++) {
                    try {
                        Thread.sleep(100);
                        System.out.println(Thread.currentThread().getName() + "你好" + i);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        },"zhangsan").start();

        for (int i = 0; i < 4; i++) {
            System.out.println("main函数" + i);
        }
    }
}
